﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Reflection;
using Pixysoft.Weblications.Sango.Dao;
using Pixysoft.Weblications.Sango.Environment;
using Pixysoft.Weblications.Sango.Constant;

namespace Pixysoft.Weblications.Sango.Command.officer
{
    partial class SangoOfficerHandler
    {
        public officer_trainbuyinfo officer_trainbuyinfo()
        {
            string userCode = SangoManager.Authentication();

            officer_trainbuyinfo response = ReflectionManager.CreatePojo<officer_trainbuyinfo>();
            response.Succeed = false;

            Entities.Usr_Profile profile = UsrProfileDao.getUsrProfile(userCode);
            Entities.Usr_Property property = UsrPropertyDao.getProperty(userCode);

            if (property.Trainingcount >= SysVipSettingHelper.search(profile.Viplevel).Officerupgradeqty)
            {
                response.Message = "当前VIP等级不足，无法扩展训练位";
                return response;
            }

            Entities.Sys_Queue queue = UsrQueueDao.getAvailableSysQueue(userCode, CtiQueueTypecodeCollection.OFFICER_UPGRADE);

            if (queue == null)
            {
                response.Message = "无训练为可购买";
                return response;
            }

            response.goldprice = queue.Goldprice;
            response.Succeed = true;
            return response;
        }


    }
    public interface officer_trainbuyinfo : ISangoResponse
    {
        long goldprice { get;set;}
    }
}
